import React, { useState } from 'react';
import Son from './Son';
import Daughter from './daughter';

const Father = () => {
  const nameValue = '父组件传递的数据'
  const [msg, setMsg] = useState('')
  const getMsg = (msg) => {
    console.log('子组件传递的数据', msg)
    setMsg(msg)
  }
  return (
    <div>
      <Son onGwtSonMsg={getMsg} name={nameValue} child={<p>p标签</p>}>
        <h6>h66666</h6>
      </Son>
      {msg}
      <Daughter msg={msg}></Daughter>
    </div>
  );
};

export default Father;